Programming Languages Section

Emacs Lisp

Card image
Post by Amina Delali, September 20th,2021

Some Facts

Also called Elisp, Emacs Lisp is used as the scripting language of the Emacs editor besides the C programming language. It is a dialect of the Lisp programming language that can also be used to extend Emacs functions as well as a scripting language by calling the Emacs in batch mode ( without the editor’s user interface). 

Not only that, but Emacs Lisp is a full programming language, with expressions interpreted by the Lisp interpreter. It has also a compiler that translates functions written in Lisp into a byte-code evaluated by the byte-code interpreter and transportable from machine to machine without recompilation.



How to install it

  • on Windows:

    To install Emacs Lisp on Windows 10, you will simply have to install the Emacs editor. To do that, just follow the instructions below:

    1. just go to this emacs versions page and select the right version folder . For example: emacs-27 (at the time of writing this post, emacs-27 is the latest version). You will be directed to another page with the actual versions to install.
    2. from that page select the right installer for you. For example, emacs-27.1-x86_64-installer.exe, the installer for Windows 10 64 bit version.
    3. run the installer. And after installation is complete,  create a desktop shortcut pointing to the  bin\runemacs.exe file.
    4. launch runemacs.exe from this desktop shortcut.
  • on ubuntu :

    As with the Windows 10  installation, you will have to install the Emacs Editor. But you may already find that the editor is already installed on your Ubuntu operating system. And if it is not the case, just follow the instructions below:

    1. open the terminal and run the following commands: sudo apt update
      sudo apt install emacs
    2. to check the installed version, just run this next command: emacs --version

In the video below, the details of the installation of the Emacs Lisplanguage on Ubuntu.

The Hello World Example

To test your Emacs Lisp script on Ubuntu, just follow the next described steps:

  1. create a new file in the Home folder, and name it “Hello.el
  2. write and save in that created file the following code:
    (print "Hello World!")
  3. to run the script, open the terminal and run the following command: emacs --script Hello.el


Additional Information

For more information about the Emacs Lisp language and the corresponding code, you can check the following pages:

Something to say ?

If you want to add something about the Emacs Lisp language or about this post, please feel free to do it by commenting below 🙂 .